home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_olv_snaketotem_bridge.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
7KB
|
349 lines
# Jones 3D Cog Script
#
# olv_snaketotem_bridge.cog
#
# Cog to knock over snake totem.
#
# [DS & revised by HB]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ==============================================================================
symbols
message startup
message activated
message entered
message exited
message touched
message pulse
keyframe in_push=in_push_nomove.key local
keyframe in_touch=in_activate_medium_left.key local
keyframe in_push2=in_olv_push_nomove.key local
sound pushsnd0=inxj092.wav local # when below no go.
sound pushsnd1=inxj112.wav local # pushing down.
sound touchsnd=inxj030.wav local # first touched.
# sound hitsnd=olv_rockhead_hitearth_c.wav local
sound hitsnd=nub_stonedoor_stop_c.wav local
sound fallsnd=tem_lava_mouth_c.wav local
sound music0=mus_gen_awechord1.wav local
thing totem0
thing totem_cam nolink
thing totem_ct nolink
thing totem_poscam nolink
thing inviso_head nolink
sector temple0
sector totemslot
cog hints # send message when complete
vector v_campos local
float moveSpeed=3.0 local
int curcam local
int hit local
int fall local
int climbed=0 local
int totemstatus local
int moveStatus local
int fallen=0 local
int touched=0 local
int vibe local
int shake local
flex MoveTotem Local
thing player local
int push local
int nope local
flex checkstatus local
vector posoffset local
vector angoffset local
end
# ------------------------------------------------------------------------------
code
startup:
player=GetLocalPlayerThing();
SetThingLight(totem0, '0.5 0.5 0.4', 0.01, 0.01);
return;
# ..............................................................................
entered:
if (getsenderref() != temple0)
{
return;
}
if (fallen == 1)
{
return;
}
# Print("entered push sector");
climbed = 1;
return;
# ..............................................................................
exited:
if (getsenderref() != temple0)
{
return;
}
climbed = 0;
# Print("exited push sector");
return;
# ..............................................................................
touched:
if (fallen == 1)
{
return;
}
if (touched == 1)
{
return;
}
touched = 1;
MakeMeStop();
DeselectWeaponWait(player);
PlayKey(player, in_touch, 4, 0x12, 1);
PlayVoice(player, touchsnd, 1.0, 1);
ClearActorFlags(player, 0x200000);
return;
# ..............................................................................
activated:
if (fallen == 1)
{
return;
}
MakeMeStop();
DeselectWeaponWait(player);
StartCutscene(1);
# Print("totem activated");
if (climbed == 0)
{
push = PlayKey(player, in_push2, 4, 0x12, 1);
ClearActorFlags(player, 0x200000);
nope = PlayVoice(player, pushsnd0, 1.0, 1);
EndCutscene();
return;
}
if (climbed == 1)
{
push = PlayKey(player, in_push, 4, 0x12, 0);
sleep(1.3);
call CheckStatus;
if (moveStatus)
{
return;
}
if (totemStatus == 0)
{
fallen = 1;
goto MoveTotem;
}
WaitForStop(push);
ClearActorFlags(player, 0x200000);
EndCutscene();
}
return;
# ..............................................................................
MoveTotem:
StartCutScene(1);
fall=PlaySoundThing(fallsnd, totem0, 1, 10, 20, 1);
AttachThingToThingEx(totem_ct, totem0, 0x0C);
rotatepivot(totem0, 1, moveSpeed);
# Watch the bridge fall into place...
curcam = GetCurrentCamera();
SetCameraLookInterp(2, 0);
SetCameraPosInterp(2, 0);
SetCameraFocus(2, totem_cam);
SetCameraSecondaryFocus(2, totem_ct);
SetCurrentCamera(2);
SetCameraFOV(70, 0, 0.0);
Sleep(0.01);
SetCameraFOV(90, 1, 3.0);
waitforstop(totem0);
PlaySoundThing(hitsnd, totem0, 1, 10, 20, 0);
rotate(totem0, 25, 2, 0.4);
waitforstop(totem0);
StopSound(fall, 0.01);
hit = PlaySoundThing(hitsnd, totem0, 1, 10, 20, 0);
jumptoframe(totem0, 2, totemslot);
hit = PlaySoundThing(hitsnd, totem0, 1, 10, 20, 0);
# TO DO: camera shake here...
shake = 2;
SetPulse(0.1);
Sleep(0.5);
shake = 1;
Sleep(0.5); # at least
waitforsound(hit);
SetPulse(0.0);
v_campos = GetThingPOS(totem_poscam);
SetCameraPosition(1, v_campos); # prep to swing back to follow-cam
SetCurrentCamera(curcam);
ResetCameraFOV(0, 0.0);
PlaySoundLocal(music0, 0.7, 0.0, 0x0, 0);
sleep(2.0);
PlayVoice(player, pushsnd1, 1.0, 0);
SendMessage(hints, user4);
DestroyThing(inviso_head);
EndCutScene();
ClearActorFlags(player, 0x200000);
return;
# ..............................................................................
CheckStatus:
moveStatus = 0;
totemstatus = 0;
if (totem0 >= 0)
{
moveStatus = moveStatus + IsThingMoving(totem0);
totemstatus = totemstatus + GetCurFrame(totem0);
}
return;
# ..............................................................................
pulse:
if (shake == 3)
{
vibe = RandBetween(1, 3);
if (vibe == 3)
{
# Skip this time...
return;
}
}
vibe = RandBetween(1, 4);
if (vibe == 1)
{
if (shake == 1)
{
posOffset = '-0.005 0.00 -0.001'; #1
angOffset = '0.00 -0.001 0.001';
}
if (shake == 2)
{
posOffset = '0.01 -0.01 0.005'; #2
angOffset = '0.005 0.00 -0.005';
}
if (shake == 3)
{
posOffset = '0.01 0.02 -0.02'; #3
angOffset = '-0.01 0.01 -0.01';
}
}
if (vibe == 2)
{
if (shake == 1)
{
posOffset = '0.005 -0.002 0.001'; #2 was .005x
angOffset = '0.001 0.00 -0.001';
}
if (shake == 2)
{
posOffset = '0.005 0.01 -0.01'; #3
angOffset = '-0.005 0.005 -0.00';
}
if (shake == 3)
{
posOffset = '-0.02 0.00 0.02'; #4
angOffset = '0.00 0.00 0.01';
}
}
if (vibe == 3)
{
if (shake == 1)
{
posOffset = '0.002 0.002 -0.002'; #3
angOffset = '-0.001 0.002 -0.002';
}
if (shake == 2)
{
posOffset = '-0.015 0.00 0.01'; #4 was .01x
angOffset = '0.00 0.00 0.01';
}
if (shake == 3)
{
posOffset = '-0.025 0.00 -0.01'; #1 was .02x
angOffset = '0.00 -0.01 0.01';
}
}
if (vibe == 4)
{
if (shake == 1)
{
posOffset = '-0.001 0.00 0.002'; #4
angOffset = '0.00 0.00 0.001';
}
if (shake == 2)
{
posOffset = '-0.01 0.00 -0.005'; #1
angOffset = '0.00 -0.005 0.005';
}
if (shake == 3)
{
posOffset = '0.02 -0.02 0.01'; #2
angOffset = '0.01 0.00 -0.01';
}
}
vibe = RandBetween(1, 3);
if (vibe == 1)
{
SetPulse(0.05);
}
if (vibe == 2)
{
SetPulse(0.1);
}
if (vibe == 3)
{
SetPulse(0.15);
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
return;
end